Option Strict On
Option Explicit On 
Imports System
Imports Microsoft.VisualBasic.ControlChars

Public Class frmTimePeriod
    Inherits System.Windows.Forms.Form
    Public Shared intTimeStyle As Integer  'tells what format is in use for time
    Public Shared intDateType As Integer   'tells what kind of date structure is needed
    '1 = single Gregorian date/time; 2 = range of Gregorian date/time
    Public Shared begDate As SngDateTime  'also used for single Gregorian date/time
    Public Shared endDate As SngDateTime
    Friend WithEvents button_example As System.Windows.Forms.Button
    Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Public Shared bChange As Boolean = False 'tells calling routine whether date has been OK'd or Cancel'd


#Region " Windows Form Designer generated code "

    Public Sub New(ByVal inTime As Integer, ByVal inDate1 As SngDateTime)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        intDateType = 1
        intTimeStyle = inTime
        begDate = inDate1
        'Add any initialization after the InitializeComponent() call

    End Sub

    Public Sub New(ByVal inTime As Integer, ByVal inDate1 As SngDateTime, ByVal inDate2 As SngDateTime)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        intDateType = 2
        intTimeStyle = inTime
        begDate = inDate1
        endDate = inDate2

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents cboxTimeDiff As System.Windows.Forms.ComboBox
    Friend WithEvents lblTdiff As System.Windows.Forms.Label
    Friend WithEvents txtTime As System.Windows.Forms.TextBox
    Friend WithEvents lblTime1 As System.Windows.Forms.Label
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents rdoEarlyBCE As System.Windows.Forms.RadioButton
    Friend WithEvents rdoCE As System.Windows.Forms.RadioButton
    Friend WithEvents rdoBCE As System.Windows.Forms.RadioButton
    Friend WithEvents cboxDay As System.Windows.Forms.ComboBox
    Friend WithEvents cboxMonth As System.Windows.Forms.ComboBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents cboxTimeDiff2 As System.Windows.Forms.ComboBox
    Friend WithEvents txtTime2 As System.Windows.Forms.TextBox
    Friend WithEvents lblTime2 As System.Windows.Forms.Label
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents rdoEarlyBCE2 As System.Windows.Forms.RadioButton
    Friend WithEvents rdoCE2 As System.Windows.Forms.RadioButton
    Friend WithEvents rdoBCE2 As System.Windows.Forms.RadioButton
    Friend WithEvents cboxDay2 As System.Windows.Forms.ComboBox
    Friend WithEvents cboxMonth2 As System.Windows.Forms.ComboBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents lblTDiff2 As System.Windows.Forms.Label
    Friend WithEvents btnOK1 As System.Windows.Forms.Button
    Friend WithEvents btnCancel1 As System.Windows.Forms.Button
    Friend WithEvents btnCancel2 As System.Windows.Forms.Button
    Friend WithEvents btnOK2 As System.Windows.Forms.Button
    Friend WithEvents numYear As System.Windows.Forms.NumericUpDown
    Friend WithEvents numYear2 As System.Windows.Forms.NumericUpDown
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmTimePeriod))
        Me.cboxTimeDiff = New System.Windows.Forms.ComboBox
        Me.lblTdiff = New System.Windows.Forms.Label
        Me.txtTime = New System.Windows.Forms.TextBox
        Me.lblTime1 = New System.Windows.Forms.Label
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.numYear = New System.Windows.Forms.NumericUpDown
        Me.rdoEarlyBCE = New System.Windows.Forms.RadioButton
        Me.rdoCE = New System.Windows.Forms.RadioButton
        Me.rdoBCE = New System.Windows.Forms.RadioButton
        Me.cboxDay = New System.Windows.Forms.ComboBox
        Me.cboxMonth = New System.Windows.Forms.ComboBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.Label6 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.btnCancel2 = New System.Windows.Forms.Button
        Me.btnOK2 = New System.Windows.Forms.Button
        Me.cboxTimeDiff2 = New System.Windows.Forms.ComboBox
        Me.lblTDiff2 = New System.Windows.Forms.Label
        Me.txtTime2 = New System.Windows.Forms.TextBox
        Me.lblTime2 = New System.Windows.Forms.Label
        Me.Panel3 = New System.Windows.Forms.Panel
        Me.numYear2 = New System.Windows.Forms.NumericUpDown
        Me.rdoEarlyBCE2 = New System.Windows.Forms.RadioButton
        Me.rdoCE2 = New System.Windows.Forms.RadioButton
        Me.rdoBCE2 = New System.Windows.Forms.RadioButton
        Me.cboxDay2 = New System.Windows.Forms.ComboBox
        Me.cboxMonth2 = New System.Windows.Forms.ComboBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.Label9 = New System.Windows.Forms.Label
        Me.Label10 = New System.Windows.Forms.Label
        Me.Label11 = New System.Windows.Forms.Label
        Me.Label12 = New System.Windows.Forms.Label
        Me.btnOK1 = New System.Windows.Forms.Button
        Me.btnCancel1 = New System.Windows.Forms.Button
        Me.button_example = New System.Windows.Forms.Button
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.Panel2.SuspendLayout()
        CType(Me.numYear, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Panel1.SuspendLayout()
        Me.Panel3.SuspendLayout()
        CType(Me.numYear2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'cboxTimeDiff
        '
        Me.cboxTimeDiff.Items.AddRange(New Object() {"-0500  Eastern Standard Time", "-0400  Eastern Daylight Time", "-0600  Central Standard Time", "-0500  Central Daylight Time", "-0700  Mountain Standard Time", "-0600  Mountain Daylight Time", "-0800  Pacific Standard Time", "-0700  Pacific Daylight Time", "-0900  Alaska", "-1000  Hawaii"})
        Me.cboxTimeDiff.Location = New System.Drawing.Point(320, 73)
        Me.cboxTimeDiff.MaxDropDownItems = 6
        Me.cboxTimeDiff.Name = "cboxTimeDiff"
        Me.cboxTimeDiff.Size = New System.Drawing.Size(208, 21)
        Me.cboxTimeDiff.TabIndex = 8
        Me.ToolTip1.SetToolTip(Me.cboxTimeDiff, "Time Differential")
        Me.cboxTimeDiff.Visible = False
        '
        'lblTdiff
        '
        Me.lblTdiff.Location = New System.Drawing.Point(232, 71)
        Me.lblTdiff.Name = "lblTdiff"
        Me.lblTdiff.Size = New System.Drawing.Size(100, 23)
        Me.lblTdiff.TabIndex = 0
        Me.lblTdiff.Text = "Time Differential:"
        Me.lblTdiff.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.ToolTip1.SetToolTip(Me.lblTdiff, "Time Differential")
        Me.lblTdiff.Visible = False
        '
        'txtTime
        '
        Me.txtTime.Location = New System.Drawing.Point(376, 41)
        Me.txtTime.MaxLength = 6
        Me.txtTime.Name = "txtTime"
        Me.txtTime.Size = New System.Drawing.Size(88, 20)
        Me.txtTime.TabIndex = 7
        Me.ToolTip1.SetToolTip(Me.txtTime, "Universal Time (HHMMSS)")
        '
        'lblTime1
        '
        Me.lblTime1.Location = New System.Drawing.Point(232, 42)
        Me.lblTime1.Name = "lblTime1"
        Me.lblTime1.Size = New System.Drawing.Size(144, 16)
        Me.lblTime1.TabIndex = 0
        Me.lblTime1.Text = "Universal Time (HHMMSS):"
        Me.lblTime1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.ToolTip1.SetToolTip(Me.lblTime1, "Universal Time (HHMMSS)")
        '
        'Panel2
        '
        Me.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel2.Controls.Add(Me.numYear)
        Me.Panel2.Controls.Add(Me.rdoEarlyBCE)
        Me.Panel2.Controls.Add(Me.rdoCE)
        Me.Panel2.Controls.Add(Me.rdoBCE)
        Me.Panel2.Controls.Add(Me.cboxDay)
        Me.Panel2.Controls.Add(Me.cboxMonth)
        Me.Panel2.Controls.Add(Me.Label7)
        Me.Panel2.Controls.Add(Me.Label6)
        Me.Panel2.Controls.Add(Me.Label5)
        Me.Panel2.Location = New System.Drawing.Point(15, 28)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(208, 133)
        Me.Panel2.TabIndex = 0
        '
        'numYear
        '
        Me.numYear.Location = New System.Drawing.Point(56, 46)
        Me.numYear.Maximum = New Decimal(New Integer() {9999, 0, 0, 0})
        Me.numYear.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
        Me.numYear.Name = "numYear"
        Me.numYear.Size = New System.Drawing.Size(112, 20)
        Me.numYear.TabIndex = 4
        Me.numYear.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.numYear.Value = New Decimal(New Integer() {1, 0, 0, 0})
        '
        'rdoEarlyBCE
        '
        Me.rdoEarlyBCE.Location = New System.Drawing.Point(8, 8)
        Me.rdoEarlyBCE.Name = "rdoEarlyBCE"
        Me.rdoEarlyBCE.Size = New System.Drawing.Size(96, 24)
        Me.rdoEarlyBCE.TabIndex = 1
        Me.rdoEarlyBCE.Text = "Pre-9999 BCE"
        '
        'rdoCE
        '
        Me.rdoCE.Checked = True
        Me.rdoCE.Location = New System.Drawing.Point(160, 8)
        Me.rdoCE.Name = "rdoCE"
        Me.rdoCE.Size = New System.Drawing.Size(48, 24)
        Me.rdoCE.TabIndex = 3
        Me.rdoCE.TabStop = True
        Me.rdoCE.Text = "CE"
        '
        'rdoBCE
        '
        Me.rdoBCE.Location = New System.Drawing.Point(104, 8)
        Me.rdoBCE.Name = "rdoBCE"
        Me.rdoBCE.Size = New System.Drawing.Size(56, 24)
        Me.rdoBCE.TabIndex = 2
        Me.rdoBCE.Text = "BCE"
        '
        'cboxDay
        '
        Me.cboxDay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxDay.Items.AddRange(New Object() {"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"})
        Me.cboxDay.Location = New System.Drawing.Point(56, 99)
        Me.cboxDay.Name = "cboxDay"
        Me.cboxDay.Size = New System.Drawing.Size(112, 21)
        Me.cboxDay.TabIndex = 6
        '
        'cboxMonth
        '
        Me.cboxMonth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxMonth.Items.AddRange(New Object() {"00 Not known", "01 January", "02 February", "03 March", "04 April", "05 May", "06 June", "07 July", "08 August", "09 September", "10 October", "11 November", "12 December"})
        Me.cboxMonth.Location = New System.Drawing.Point(56, 72)
        Me.cboxMonth.Name = "cboxMonth"
        Me.cboxMonth.Size = New System.Drawing.Size(112, 21)
        Me.cboxMonth.TabIndex = 5
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(8, 102)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(48, 16)
        Me.Label7.TabIndex = 0
        Me.Label7.Text = "Day"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(8, 77)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(56, 16)
        Me.Label6.TabIndex = 0
        Me.Label6.Text = "Month"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(8, 48)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(40, 16)
        Me.Label5.TabIndex = 0
        Me.Label5.Text = "Year"
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(232, 9)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(184, 16)
        Me.Label3.TabIndex = 0
        Me.Label3.Text = "Time (optional)"
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(12, 9)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(112, 16)
        Me.Label2.TabIndex = 0
        Me.Label2.Text = "Date"
        '
        'Panel1
        '
        Me.Panel1.Controls.Add(Me.btnCancel2)
        Me.Panel1.Controls.Add(Me.btnOK2)
        Me.Panel1.Controls.Add(Me.cboxTimeDiff2)
        Me.Panel1.Controls.Add(Me.lblTDiff2)
        Me.Panel1.Controls.Add(Me.txtTime2)
        Me.Panel1.Controls.Add(Me.lblTime2)
        Me.Panel1.Controls.Add(Me.Panel3)
        Me.Panel1.Controls.Add(Me.Label11)
        Me.Panel1.Controls.Add(Me.Label12)
        Me.Panel1.Enabled = False
        Me.Panel1.Location = New System.Drawing.Point(3, 167)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(568, 178)
        Me.Panel1.TabIndex = 0
        '
        'btnCancel2
        '
        Me.btnCancel2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnCancel2.Image = CType(resources.GetObject("btnCancel2.Image"), System.Drawing.Image)
        Me.btnCancel2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnCancel2.Location = New System.Drawing.Point(450, 144)
        Me.btnCancel2.Name = "btnCancel2"
        Me.btnCancel2.Size = New System.Drawing.Size(75, 23)
        Me.btnCancel2.TabIndex = 20
        Me.btnCancel2.Text = "Cancel"
        Me.btnCancel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnOK2
        '
        Me.btnOK2.Enabled = False
        Me.btnOK2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnOK2.Image = CType(resources.GetObject("btnOK2.Image"), System.Drawing.Image)
        Me.btnOK2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnOK2.Location = New System.Drawing.Point(369, 144)
        Me.btnOK2.Name = "btnOK2"
        Me.btnOK2.Size = New System.Drawing.Size(75, 23)
        Me.btnOK2.TabIndex = 19
        Me.btnOK2.Text = "OK"
        Me.btnOK2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'cboxTimeDiff2
        '
        Me.cboxTimeDiff2.Items.AddRange(New Object() {"-0500  Eastern Standard Time", "-0400  Eastern Daylight Time", "-0600  Central Standard Time", "-0500  Central Daylight Time", "-0700  Mountain Standard Time", "-0600  Mountain Daylight Time", "-0800  Pacific Standard Time", "-0700  Pacific Daylight Time", "-0900  Alaska", "-1000  Hawaii"})
        Me.cboxTimeDiff2.Location = New System.Drawing.Point(317, 77)
        Me.cboxTimeDiff2.MaxDropDownItems = 6
        Me.cboxTimeDiff2.Name = "cboxTimeDiff2"
        Me.cboxTimeDiff2.Size = New System.Drawing.Size(208, 21)
        Me.cboxTimeDiff2.TabIndex = 16
        Me.ToolTip1.SetToolTip(Me.cboxTimeDiff2, "Time Differential")
        Me.cboxTimeDiff2.Visible = False
        '
        'lblTDiff2
        '
        Me.lblTDiff2.Location = New System.Drawing.Point(229, 75)
        Me.lblTDiff2.Name = "lblTDiff2"
        Me.lblTDiff2.Size = New System.Drawing.Size(100, 23)
        Me.lblTDiff2.TabIndex = 0
        Me.lblTDiff2.Text = "Time Differential:"
        Me.lblTDiff2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.ToolTip1.SetToolTip(Me.lblTDiff2, "Time Differential")
        Me.lblTDiff2.Visible = False
        '
        'txtTime2
        '
        Me.txtTime2.Location = New System.Drawing.Point(373, 45)
        Me.txtTime2.MaxLength = 6
        Me.txtTime2.Name = "txtTime2"
        Me.txtTime2.Size = New System.Drawing.Size(88, 20)
        Me.txtTime2.TabIndex = 15
        Me.txtTime2.Text = "17"
        Me.ToolTip1.SetToolTip(Me.txtTime2, "Universal Time (HHMMSS)")
        '
        'lblTime2
        '
        Me.lblTime2.Location = New System.Drawing.Point(229, 46)
        Me.lblTime2.Name = "lblTime2"
        Me.lblTime2.Size = New System.Drawing.Size(144, 16)
        Me.lblTime2.TabIndex = 0
        Me.lblTime2.Text = "Universal Time (HHMMSS):"
        Me.lblTime2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.ToolTip1.SetToolTip(Me.lblTime2, "Universal Time (HHMMSS)")
        '
        'Panel3
        '
        Me.Panel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel3.Controls.Add(Me.numYear2)
        Me.Panel3.Controls.Add(Me.rdoEarlyBCE2)
        Me.Panel3.Controls.Add(Me.rdoCE2)
        Me.Panel3.Controls.Add(Me.rdoBCE2)
        Me.Panel3.Controls.Add(Me.cboxDay2)
        Me.Panel3.Controls.Add(Me.cboxMonth2)
        Me.Panel3.Controls.Add(Me.Label8)
        Me.Panel3.Controls.Add(Me.Label9)
        Me.Panel3.Controls.Add(Me.Label10)
        Me.Panel3.Location = New System.Drawing.Point(12, 32)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(208, 135)
        Me.Panel3.TabIndex = 0
        '
        'numYear2
        '
        Me.numYear2.Location = New System.Drawing.Point(56, 46)
        Me.numYear2.Maximum = New Decimal(New Integer() {9999, 0, 0, 0})
        Me.numYear2.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
        Me.numYear2.Name = "numYear2"
        Me.numYear2.Size = New System.Drawing.Size(111, 20)
        Me.numYear2.TabIndex = 12
        Me.numYear2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.numYear2.Value = New Decimal(New Integer() {1, 0, 0, 0})
        '
        'rdoEarlyBCE2
        '
        Me.rdoEarlyBCE2.Location = New System.Drawing.Point(8, 8)
        Me.rdoEarlyBCE2.Name = "rdoEarlyBCE2"
        Me.rdoEarlyBCE2.Size = New System.Drawing.Size(96, 24)
        Me.rdoEarlyBCE2.TabIndex = 9
        Me.rdoEarlyBCE2.Text = "Pre-9999 BCE"
        '
        'rdoCE2
        '
        Me.rdoCE2.Checked = True
        Me.rdoCE2.Location = New System.Drawing.Point(160, 8)
        Me.rdoCE2.Name = "rdoCE2"
        Me.rdoCE2.Size = New System.Drawing.Size(48, 24)
        Me.rdoCE2.TabIndex = 11
        Me.rdoCE2.TabStop = True
        Me.rdoCE2.Text = "CE"
        '
        'rdoBCE2
        '
        Me.rdoBCE2.Location = New System.Drawing.Point(104, 8)
        Me.rdoBCE2.Name = "rdoBCE2"
        Me.rdoBCE2.Size = New System.Drawing.Size(56, 24)
        Me.rdoBCE2.TabIndex = 10
        Me.rdoBCE2.Text = "BCE"
        '
        'cboxDay2
        '
        Me.cboxDay2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxDay2.Items.AddRange(New Object() {"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"})
        Me.cboxDay2.Location = New System.Drawing.Point(56, 99)
        Me.cboxDay2.Name = "cboxDay2"
        Me.cboxDay2.Size = New System.Drawing.Size(111, 21)
        Me.cboxDay2.TabIndex = 14
        '
        'cboxMonth2
        '
        Me.cboxMonth2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxMonth2.Items.AddRange(New Object() {"00 Not known", "01 January", "02 February", "03 March", "04 April", "05 May", "06 June", "07 July", "08 August", "09 September", "10 October", "11 November", "12 December"})
        Me.cboxMonth2.Location = New System.Drawing.Point(56, 72)
        Me.cboxMonth2.Name = "cboxMonth2"
        Me.cboxMonth2.Size = New System.Drawing.Size(112, 21)
        Me.cboxMonth2.TabIndex = 13
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(8, 102)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(48, 16)
        Me.Label8.TabIndex = 0
        Me.Label8.Text = "Day"
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(8, 75)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(56, 16)
        Me.Label9.TabIndex = 0
        Me.Label9.Text = "Month"
        '
        'Label10
        '
        Me.Label10.Location = New System.Drawing.Point(8, 48)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(40, 16)
        Me.Label10.TabIndex = 0
        Me.Label10.Text = "Year"
        '
        'Label11
        '
        Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label11.Location = New System.Drawing.Point(229, 13)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(184, 16)
        Me.Label11.TabIndex = 0
        Me.Label11.Text = "Ending Time (optional)"
        '
        'Label12
        '
        Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label12.Location = New System.Drawing.Point(9, 13)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(112, 16)
        Me.Label12.TabIndex = 0
        Me.Label12.Text = "Ending Date"
        '
        'btnOK1
        '
        Me.btnOK1.Enabled = False
        Me.btnOK1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnOK1.Image = CType(resources.GetObject("btnOK1.Image"), System.Drawing.Image)
        Me.btnOK1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnOK1.Location = New System.Drawing.Point(372, 138)
        Me.btnOK1.Name = "btnOK1"
        Me.btnOK1.Size = New System.Drawing.Size(75, 23)
        Me.btnOK1.TabIndex = 17
        Me.btnOK1.Text = "OK"
        Me.btnOK1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnCancel1
        '
        Me.btnCancel1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnCancel1.Image = CType(resources.GetObject("btnCancel1.Image"), System.Drawing.Image)
        Me.btnCancel1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnCancel1.Location = New System.Drawing.Point(453, 138)
        Me.btnCancel1.Name = "btnCancel1"
        Me.btnCancel1.Size = New System.Drawing.Size(75, 23)
        Me.btnCancel1.TabIndex = 18
        Me.btnCancel1.Text = "Cancel"
        Me.btnCancel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'button_example
        '
        Me.button_example.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.button_example.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.button_example.Image = Global.MetaDoc.My.Resources.Resources.app_help_48x48
        Me.button_example.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.button_example.Location = New System.Drawing.Point(494, 12)
        Me.button_example.Name = "button_example"
        Me.button_example.Size = New System.Drawing.Size(110, 48)
        Me.button_example.TabIndex = 21
        Me.button_example.Text = "EXAMPLE"
        Me.button_example.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.button_example.UseVisualStyleBackColor = True
        '
        'ToolTip1
        '
        Me.ToolTip1.IsBalloon = True
        Me.ToolTip1.ShowAlways = True
        Me.ToolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
        '
        'frmTimePeriod
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.AutoScroll = True
        Me.ClientSize = New System.Drawing.Size(616, 349)
        Me.ControlBox = False
        Me.Controls.Add(Me.button_example)
        Me.Controls.Add(Me.btnCancel1)
        Me.Controls.Add(Me.btnOK1)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.cboxTimeDiff)
        Me.Controls.Add(Me.lblTdiff)
        Me.Controls.Add(Me.txtTime)
        Me.Controls.Add(Me.lblTime1)
        Me.Controls.Add(Me.Panel2)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmTimePeriod"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Time Period Information"
        Me.Panel2.ResumeLayout(False)
        CType(Me.numYear, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Panel1.ResumeLayout(False)
        Me.Panel1.PerformLayout()
        Me.Panel3.ResumeLayout(False)
        CType(Me.numYear2, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub frmTimePeriod_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strDate As String = ""
        Dim intDate As Integer = 0
        Dim strYr As String = ""
        Dim strMth As String = ""
        Dim strMthCount As String = ""
        Dim strDay As String = ""
        Dim icount As Integer = 0  ' loop counter

        'find current year, convert to decimal; setting the Year combo box
        Dim dtYear As Date = Now
        Dim strCurYear As String = dtYear.ToString("yyyy")
        Dim dCurYear As Decimal = CType(strCurYear, Decimal)

        Dim strBaseTime As String = ""
        Dim strTimDiff As String = ""


        If (intDateType = 2) Then
            Label2.Text = "Beginning Date"
            Label3.Text = "Beginning Time (optional)"
        End If

        'set the Date control
        strDate = begDate.SngDate
        intDate = Len(strDate)
        If (intDate > 0) Then  'handles case of editing a date
            strYr = Microsoft.VisualBasic.Left(strDate, 2)
            If (strYr = "cc") Then
                rdoEarlyBCE.Checked = True
                strYr = Mid(strDate, 3) 'no months or days
            ElseIf (strYr = "bc") Then
                rdoBCE.Checked = True
                strDate = Mid(strDate, 3) 'month and day allowed, so set up for processing
            End If

            If (rdoEarlyBCE.Checked = True) Then  'block extracts month and day from passed in string
                'do nothing
            Else
                strYr = Microsoft.VisualBasic.Left(strDate, 4)
                If (intDate > 4) Then  ' set Month combo box if known
                    strMth = Mid(strDate, 5, 2)
                    icount = cboxMonth.FindString(strMth)
                    cboxMonth.SelectedIndex = icount
                End If
                If (intDate > 6) Then  ' set Day combo box if known
                    strDay = Mid(strDate, 7, 2)
                    cboxDay.SelectedItem = strDay
                End If
            End If

            'set up year control
            If (rdoEarlyBCE.Checked = True) Then
                numYear.Minimum = 10000
                numYear.Maximum = 1000000000
            End If
            numYear.Value = Convert.ToDecimal(strYr)
        Else          'handles case of adding a date
            numYear.Value = dCurYear
        End If

        'set optional Time controls
        strBaseTime = begDate.TimeOfDay
        strTimDiff = ""
        lblTdiff.Visible = False
        cboxTimeDiff.Visible = False

        If (intTimeStyle = 1) Then
            lblTime1.Text = "Local time (HHMMSS):"
            txtTime.Text = strBaseTime
        ElseIf (intTimeStyle = 2) Then
            lblTime1.Text = "Local time (HHMMSS):"
            If (Len(strBaseTime) > 0) Then
                icount = InStr(strBaseTime, "+")
                If (icount = 0) Then
                    icount = InStr(strBaseTime, "-")
                End If
                If (icount = 0) Then
                    txtTime.Text = ""
                Else
                    txtTime.Text = Microsoft.VisualBasic.Left(strBaseTime, icount - 1)
                    strTimDiff = Mid(strBaseTime, icount)
                End If
                intDate = cboxTimeDiff.FindString(strTimDiff)
                If (intDate = -1) Then
                    cboxTimeDiff.Items.Add(strTimDiff)
                    cboxTimeDiff.SelectedItem = strTimDiff
                Else
                    cboxTimeDiff.SelectedIndex = intDate
                End If
            End If
            lblTdiff.Visible = True
            cboxTimeDiff.Visible = True
        Else
            lblTime1.Text = "Universal Time (HHMMSS):"
            intDate = Len(strBaseTime)
            If (intDate > 0) Then
                txtTime.Text = Microsoft.VisualBasic.Left(strBaseTime, intDate - 1)
            Else
            End If
        End If

        If (intDateType = 2) Then   'range of dates
            btnOK1.Visible = False  'make the single date buttons invisible
            btnCancel1.Visible = False
            Panel1.Enabled = True ' make the ending date info visible
            'set the Date control
            strDate = endDate.SngDate
            intDate = Len(strDate)
            If (intDate > 0) Then  'handles case of editing a date
                strYr = Microsoft.VisualBasic.Left(strDate, 2)
                If (strYr = "cc") Then
                    rdoEarlyBCE2.Checked = True
                    strYr = Mid(strDate, 3) 'no months or days
                ElseIf (strYr = "bc") Then
                    rdoBCE2.Checked = True
                    strDate = Mid(strDate, 3) 'month and day allowed, so set up for processing
                End If

                If (rdoEarlyBCE2.Checked = True) Then  'block extracts month and day from passed in string
                Else
                    strYr = Microsoft.VisualBasic.Left(strDate, 4)
                    If (intDate > 4) Then  ' set Month combo box if known
                        strMth = Mid(strDate, 5, 2)
                        icount = cboxMonth2.FindString(strMth)
                        cboxMonth2.SelectedIndex = icount
                    End If
                    If (intDate > 6) Then  ' set Day combo box if known
                        strDay = Mid(strDate, 7, 2)
                        cboxDay2.SelectedItem = strDay
                    End If
                End If
                'set up year control
                If (rdoEarlyBCE2.Checked = True) Then
                    numYear2.Minimum = 10000
                    numYear2.Maximum = 1000000000
                End If
                numYear2.Value = Convert.ToDecimal(strYr)
            Else          'handles case of adding a date
                numYear2.Value = dCurYear
            End If

            'set optional Time controls
            strBaseTime = endDate.TimeOfDay
            strTimDiff = ""
            lblTDiff2.Visible = False
            cboxTimeDiff2.Visible = False

            If (intTimeStyle = 1) Then
                lblTime2.Text = "Local time (HHMMSS):"
                txtTime2.Text = strBaseTime
            ElseIf (intTimeStyle = 2) Then
                lblTime2.Text = "Local time (HHMMSS):"
                If (Len(strBaseTime) > 0) Then
                    icount = InStr(strBaseTime, "+")
                    If (icount = 0) Then
                        icount = InStr(strBaseTime, "-")
                    End If
                    If (icount = 0) Then
                        txtTime2.Text = ""
                    Else
                        txtTime2.Text = Microsoft.VisualBasic.Left(strBaseTime, icount - 1)
                        strTimDiff = Mid(strBaseTime, icount)
                    End If
                    intDate = cboxTimeDiff2.FindString(strTimDiff)
                    If (intDate = -1) Then
                        cboxTimeDiff2.Items.Add(strTimDiff)
                        cboxTimeDiff2.SelectedItem = strTimDiff
                    Else
                        cboxTimeDiff2.SelectedIndex = intDate
                    End If
                End If
                lblTDiff2.Visible = True
                cboxTimeDiff2.Visible = True
            Else
                lblTime2.Text = "Universal Time (HHMMSS):"
                intDate = Len(strBaseTime)
                If (intDate > 0) Then
                    txtTime2.Text = Microsoft.VisualBasic.Left(strBaseTime, intDate - 1)
                Else
                End If
            End If
        End If

    End Sub

    Private Sub rdoEarlyBCE_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoEarlyBCE.CheckedChanged
        If (rdoEarlyBCE.Checked = True) Then
            cboxMonth.Enabled = False
            cboxDay.Enabled = False
            numYear.Maximum = 1000000000
            numYear.Minimum = 10000
        End If
    End Sub

    Private Sub rdoBCE_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoBCE.CheckedChanged
        If (rdoBCE.Checked = True) Then
            cboxMonth.Enabled = True
            cboxDay.Enabled = True
            numYear.Maximum = 9999
            numYear.Minimum = 1
        End If
    End Sub

    Private Sub rdoCE_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoCE.CheckedChanged
        If (rdoCE.Checked = True) Then
            cboxMonth.Enabled = True
            cboxDay.Enabled = True
            numYear.Maximum = 9999
            numYear.Minimum = 1
        End If
    End Sub

    Private Sub btnCancel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel1.Click, btnCancel2.Click
        bChange = False
        Me.Close()
    End Sub

    Private Sub btnOK1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK1.Click
        btnok1_update()
        bChange = True
        Me.Close()
    End Sub

    Private Sub btnok1_update()
        Dim prefix As String = ""
        Dim sYr As String = ""
        Dim sTemp1 As String = ""
        Dim sTemp2 As String = ""
        Dim sTemp3 As String = ""
        Dim iYrLen As Integer = 0
        Dim iLoop As Integer = 0
        Dim sError As String = ""

        'update date information
        If (rdoEarlyBCE.Checked = True) Then
            prefix = "cc"
            sYr = prefix & numYear.Value.ToString
        ElseIf (rdoBCE.Checked = True) Then
            prefix = "bc"
        End If
        If (rdoEarlyBCE.Checked = False) Then
            sTemp1 = numYear.Value.ToString
            iYrLen = Len(sTemp1)
            If (iYrLen > 0) Then 'make sure have 4-character year representation
                For iLoop = iYrLen + 1 To 4
                    sTemp1 = "0" & sTemp1
                Next
            End If
            sTemp2 = CType(cboxMonth.SelectedItem, String)
            sTemp2 = Microsoft.VisualBasic.Left(sTemp2, 2)
            If (sTemp2 = "00" Or sTemp1 = "") Then
                sTemp2 = ""
            End If
            sTemp3 = CType(cboxDay.SelectedItem, String)
            If (sTemp3 = "00" Or sTemp2 = "") Then
                sTemp3 = ""
            End If
            If (iYrLen > 0) Then
                sYr = prefix & sTemp1 & sTemp2 & sTemp3
            Else
                sYr = ""
            End If
        End If
        begDate.SngDate = sYr

        'update time (may be blank)
        sTemp1 = txtTime.Text
        If (intTimeStyle = 1) Then
            sYr = sTemp1.Trim
        ElseIf (intTimeStyle = 2) Then
            If (cboxTimeDiff.SelectedIndex = -1) Then
                sTemp2 = cboxTimeDiff.Text
            Else
                sTemp2 = CType(cboxTimeDiff.SelectedItem, String)
            End If
            sTemp2 = sTemp2.Trim
            sYr = sTemp1.Trim & Microsoft.VisualBasic.Left(sTemp2, 5)
        Else
            sYr = sTemp1.Trim & "Z"
        End If
        If (sTemp3 = "") Then  'if no day specified, setting time difficult
            sYr = ""
        End If
        begDate.TimeOfDay = sYr
        If (rdoEarlyBCE.Checked = True) Then
            begDate.TimeOfDay = ""
        End If
    End Sub

    Private Sub btnOK2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK2.Click
        Dim prefix As String = ""
        Dim sYr As String = ""
        Dim sTemp1 As String = ""
        Dim sTemp2 As String = ""
        Dim sTemp3 As String = ""
        Dim iYrLen As Integer = 0
        Dim iLoop As Integer = 0
        Dim bValRange As Boolean = False 'True means a valid range within a time frame
        Dim sError As String = ""

        'checks for valid range
        If (rdoEarlyBCE.Checked = True) Then
            If (rdoBCE2.Checked = True Or rdoCE2.Checked = True) Then
                'range spans time eras, and so must be valid
            Else
                If (numYear.Value <= numYear2.Value) Then
                    sError = "A valid range in the Pre-BCE zone requires that the beginning year"
                    sError += CrLf & "be larger than the ending year."
                    MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    bChange = False
                    Return
                End If
            End If
        End If

        If (rdoBCE.Checked = True) Then
            If (rdoEarlyBCE2.Checked = True) Then
                sError = "Beginning date is later than ending date"
                MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                bChange = False
                Return
            ElseIf (rdoBCE2.Checked = True) Then
                If (numYear.Value < numYear2.Value) Then
                    sError = "Beginning date is later than ending date"
                    MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    bChange = False
                    Return
                ElseIf (numYear.Value = numYear2.Value) Then
                    checkMonthDay(bValRange)
                    If (bValRange = False) Then
                        sError = "Beginning date is later than ending date"
                        MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                        bChange = False
                        Return
                    End If
                Else
                    'correct year ordering
                End If
            End If
        End If

        If (rdoCE.Checked = True) Then
            If (rdoEarlyBCE2.Checked = True Or rdoBCE2.Checked = True) Then
                sError = "Beginning date is later than ending date"
                MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                bChange = False
                Return
            Else
                'both dates are CE
                If (numYear.Value > numYear2.Value) Then
                    sError = "Beginning date is later than ending date"
                    MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    bChange = False
                    Return
                ElseIf (numYear.Value = numYear2.Value) Then
                    checkMonthDay(bValRange)
                    If (bValRange = False) Then
                        sError = "Beginning date is later than ending date"
                        MessageBox.Show(sError, "Range specification error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                        bChange = False
                        Return
                    End If
                Else
                    'correct year ordering
                End If
            End If
        End If


        'update beginning of range information
        btnok1_update()

        'update end of range information
        'update date information
        If (rdoEarlyBCE2.Checked = True) Then
            prefix = "cc"
            sYr = prefix & numYear2.Value.ToString
            If (Len(sYr) = 2) Then
                sYr = ""
            End If
        ElseIf (rdoBCE2.Checked = True) Then
            prefix = "bc"
        End If
        If (rdoEarlyBCE2.Checked = False) Then
            sTemp1 = numYear2.Value.ToString
            iYrLen = Len(sTemp1)
            If (iYrLen > 0) Then 'make sure have 4-character year representation
                For iLoop = iYrLen + 1 To 4
                    sTemp1 = "0" & sTemp1
                Next
            End If
            sTemp2 = CType(cboxMonth2.SelectedItem, String)
            sTemp2 = Microsoft.VisualBasic.Left(sTemp2, 2)
            If (sTemp2 = "00" Or sTemp1 = "") Then
                sTemp2 = ""
            End If
            sTemp3 = CType(cboxDay2.SelectedItem, String)
            If (sTemp3 = "00" Or sTemp2 = "") Then
                sTemp3 = ""
            End If
            If (iYrLen > 0) Then
                sYr = prefix & sTemp1 & sTemp2 & sTemp3
            Else
                sYr = ""
            End If
        End If
        endDate = New SngDateTime
        endDate.SngDate = sYr

        'update time (may be blank)
        sTemp1 = txtTime2.Text
        If (intTimeStyle = 1) Then
            sYr = sTemp1.Trim
        ElseIf (intTimeStyle = 2) Then
            If (cboxTimeDiff2.SelectedIndex = -1) Then
                sTemp2 = cboxTimeDiff2.Text
            Else
                sTemp2 = CType(cboxTimeDiff2.SelectedItem, String)
            End If
            sTemp2 = sTemp2.Trim
            sYr = sTemp1.Trim & Microsoft.VisualBasic.Left(sTemp2, 5)
        Else
            sYr = sTemp1.Trim & "Z"
        End If
        If (sTemp3 = "") Then  'if no day specified, setting time difficult
            sYr = ""
        End If
        endDate.TimeOfDay = sYr
        If (rdoEarlyBCE2.Checked = True) Then
            begDate.TimeOfDay = ""
        End If

        bChange = True
        Me.Close()
    End Sub

    Private Sub checkMonthDay(ByRef bCheck As Boolean)
        bCheck = True
        If (cboxMonth.SelectedIndex < cboxMonth2.SelectedIndex) Then
            'valid range
        ElseIf (cboxMonth.SelectedIndex = cboxMonth2.SelectedIndex) Then
            'needs more assessment
            If (cboxDay.SelectedIndex < cboxDay2.SelectedIndex) Then
                'valid range
            ElseIf (cboxDay.SelectedIndex = cboxDay2.SelectedIndex) Then
                'is okay; not going to compare times
            Else
                'invalid range based on days
                bCheck = False
                Return
            End If
        Else
            'invalid range based on months
            bCheck = False
            Return
        End If
    End Sub

    Private Sub rdoEarlyBCE2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoEarlyBCE2.CheckedChanged
        If (rdoEarlyBCE2.Checked = True) Then
            cboxMonth2.Enabled = False
            cboxDay2.Enabled = False
            numYear2.Maximum = 1000000000
            numYear2.Minimum = 10000
        End If
    End Sub

    Private Sub rdoBCE2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoBCE2.CheckedChanged
        If (rdoBCE2.Checked = True) Then
            cboxMonth2.Enabled = True
            cboxDay2.Enabled = True
            numYear2.Maximum = 9999
            numYear2.Minimum = 1
        End If
    End Sub

    Private Sub rdoCE2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoCE2.CheckedChanged
        If (rdoCE2.Checked = True) Then
            cboxMonth2.Enabled = True
            cboxDay2.Enabled = True
            numYear2.Maximum = 9999
            numYear2.Minimum = 1
        End If
    End Sub

    Private Sub cboxMonth_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxMonth.SelectedIndexChanged
        validate1()
    End Sub

    Private Sub cboxDay_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxDay.SelectedIndexChanged
        validate1()
    End Sub
    Private Sub validate1()
        If cboxDay.SelectedIndex = -1 Or cboxMonth.SelectedIndex = -1 Then btnOK1.Enabled = False Else btnOK1.Enabled = True
    End Sub

    Private Sub cboxMonth2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxMonth2.SelectedIndexChanged
        validate2()
    End Sub

    Private Sub cboxDay2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxDay2.SelectedIndexChanged
        validate2()
    End Sub
    Private Sub validate2()
        If cboxDay.SelectedIndex = -1 Or cboxMonth.SelectedIndex = -1 Or cboxDay2.SelectedIndex = -1 Or cboxMonth2.SelectedIndex = -1 Then btnOK2.Enabled = False Else btnOK2.Enabled = True
    End Sub

    Public Function getChanged() As Boolean
        Return bChange
    End Function
    Public Function getBegDate() As SngDateTime
        Return begDate
    End Function
    Public Function getEndDate() As SngDateTime
        Return endDate
    End Function

    Private Sub button_example_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_example.Click
        Dim helpForm As dialog_help = New dialog_help("TimePeriod")
        helpForm.ShowDialog()
    End Sub
End Class
